function out=testPattern(file, w)
    TEST_PATH="../tests";
    testpath=sprintf("%s/test1/%s",TEST_PATH,file);
    pattern = getPattern(testpath)
    out=output(pattern,w);
    anspath=sprintf("%s/test1/t_%s",TEST_PATH,file);
    reBuildImage(out,anspath,false);
endfunction


function pattern=getPattern(file)
	imatrix=imread(file);
	imatrix = (imatrix*2) - 1;
	pattern=matrixToVect(imatrix);
endfunction

function v=matrixToVect(matrix)
	v=[];
	for i=1:rows(matrix)
		v=[v,matrix(i,:)];
	endfor
endfunction

